package com.lei.day10rikao;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;

import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer;

import java.util.Timer;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private StandardGSYVideoPlayer stand;
    private Button bt_lw;
    private int index = 0;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
    }

    private void initView() {
        stand = (StandardGSYVideoPlayer) findViewById(R.id.stand);
        bt_lw = (Button) findViewById(R.id.bt_lw);
        stand.setUp("http://ivi.bupt.edu.cn/hls/cctv6hd.m3u8",true,"CCTV-6");
        stand.startPlayLogic();
        bt_lw.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.bt_lw:
                bt_lw.setText(""+(++index));
                break;
        }
    }
}
